

#include "Event.h"
#include "gpio.h"

EventQueue_t eq = {0};

void PushEvent(EventScanCode event)
{
    eq.evd[eq.tail++] = event;
    if (eq.count < QUEUEMAXSIZE)
        eq.count++;
}

EventScanCode PopEvent(void)
{
    EventScanCode ev = ESC_None;
    if (eq.count)
    {
        ev = eq.evd[eq.head++];
        eq.count--;
    }
    return ev;
}

char IsEmpty(void)
{
    return (eq.count == 0);
}